﻿using System.Data.Entity.ModelConfiguration;
using ZSoftInstagram.Domain.Board;

namespace ZSoftInstagram.DataAccess.Config
{
    public class ImagePinBoardConfig: EntityTypeConfiguration<ImagePinBoard>
    {
        public ImagePinBoardConfig()
        {
            this.HasKey(pb => pb.Id);

            this.HasMany(pb => pb.Pins)
                .WithMany(p => p.PinBoards)
                    .Map(t => t.MapLeftKey("ImageBoardId").MapRightKey("ImagePinId").ToTable("ImageBoardImagePin"));
        }
    }
}
